<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>Clause: chatopera::bot::crfsuite::Trainer类 参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Clause
   &#160;<span id="projectnumber">1.0</span>
   </div>
   <div id="projectbrief">Chatopera Language Understanding Service.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'搜索');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>首页</span></a></li>
      <li><a href="pages.html"><span>相关页面</span></a></li>
      <li><a href="modules.html"><span>模块</span></a></li>
      <li><a href="namespaces.html"><span>命名空间</span></a></li>
      <li class="current"><a href="annotated.html"><span>类</span></a></li>
      <li><a href="files.html"><span>文件</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="搜索" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>类列表</span></a></li>
      <li><a href="classes.html"><span>类索引</span></a></li>
      <li><a href="inherits.html"><span>类继承关系</span></a></li>
      <li><a href="functions.html"><span>类成员</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespacechatopera.html">chatopera</a></li><li class="navelem"><b>bot</b></li><li class="navelem"><b>crfsuite</b></li><li class="navelem"><a class="el" href="classchatopera_1_1bot_1_1crfsuite_1_1Trainer.html">Trainer</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="#pro-static-methods">静态 Protected 成员函数</a> &#124;
<a href="#pro-attribs">Protected 属性</a> &#124;
<a href="classchatopera_1_1bot_1_1crfsuite_1_1Trainer-members.html">所有成员列表</a>  </div>
  <div class="headertitle">
<div class="title">chatopera::bot::crfsuite::Trainer类 参考<div class="ingroups"><a class="el" href="group__crfsuite__hpp__api__doc.html">Data structures</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;<a class="el" href="crfsuite__api_8hpp_source.html">crfsuite_api.hpp</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:a47e0b9d2f99b9745c34815493c5bc0c0"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classchatopera_1_1bot_1_1crfsuite_1_1Trainer.html#a47e0b9d2f99b9745c34815493c5bc0c0">Trainer</a> ()</td></tr>
<tr class="separator:a47e0b9d2f99b9745c34815493c5bc0c0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aad702690d74bca0e38ef4a4e8f392810"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classchatopera_1_1bot_1_1crfsuite_1_1Trainer.html#aad702690d74bca0e38ef4a4e8f392810">~Trainer</a> ()</td></tr>
<tr class="separator:aad702690d74bca0e38ef4a4e8f392810"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a11e2975f51e34d4d0058a84a40459978"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classchatopera_1_1bot_1_1crfsuite_1_1Trainer.html#a11e2975f51e34d4d0058a84a40459978">init</a> ()</td></tr>
<tr class="separator:a11e2975f51e34d4d0058a84a40459978"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad12cec6ca40c552981cd877d3ed53c4c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classchatopera_1_1bot_1_1crfsuite_1_1Trainer.html#ad12cec6ca40c552981cd877d3ed53c4c">clear</a> ()</td></tr>
<tr class="separator:ad12cec6ca40c552981cd877d3ed53c4c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a83647ff7fa0e30c64c04bb1e56a0529f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classchatopera_1_1bot_1_1crfsuite_1_1Trainer.html#a83647ff7fa0e30c64c04bb1e56a0529f">append</a> (const <a class="el" href="group__crfsuite__hpp__api__doc.html#ga34f58d96010025b06e985a6710fbfd05">ItemSequence</a> &amp;xseq, const <a class="el" href="group__crfsuite__hpp__api__doc.html#gaf82774957c9896d38894cddd592aa061">StringList</a> &amp;yseq, int group)</td></tr>
<tr class="separator:a83647ff7fa0e30c64c04bb1e56a0529f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a56b387aafec11fd9239391784136abda"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classchatopera_1_1bot_1_1crfsuite_1_1Trainer.html#a56b387aafec11fd9239391784136abda">select</a> (const std::string &amp;algorithm, const std::string &amp;type)</td></tr>
<tr class="separator:a56b387aafec11fd9239391784136abda"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a792e40b315cc6526a9d951dd9e55e5ee"><td class="memItemLeft" align="right" valign="top">crfsuite_data_t *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classchatopera_1_1bot_1_1crfsuite_1_1Trainer.html#a792e40b315cc6526a9d951dd9e55e5ee">pdata</a> ()</td></tr>
<tr class="separator:a792e40b315cc6526a9d951dd9e55e5ee"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8b95b93e0f76623f8d3c8cd9ab414871"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classchatopera_1_1bot_1_1crfsuite_1_1Trainer.html#a8b95b93e0f76623f8d3c8cd9ab414871">read_data</a> (const std::string &amp;filepath, int group=0)</td></tr>
<tr class="separator:a8b95b93e0f76623f8d3c8cd9ab414871"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aeaacda20768776e7f99f8a672b6123b3"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classchatopera_1_1bot_1_1crfsuite_1_1Trainer.html#aeaacda20768776e7f99f8a672b6123b3">train</a> (const std::string &amp;model, int holdout)</td></tr>
<tr class="separator:aeaacda20768776e7f99f8a672b6123b3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad64da31f7d1893927085a90809ad69e0"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__crfsuite__hpp__api__doc.html#gaf82774957c9896d38894cddd592aa061">StringList</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classchatopera_1_1bot_1_1crfsuite_1_1Trainer.html#ad64da31f7d1893927085a90809ad69e0">params</a> ()</td></tr>
<tr class="separator:ad64da31f7d1893927085a90809ad69e0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac4e2cdffbfb268c2a320c0099f91494a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classchatopera_1_1bot_1_1crfsuite_1_1Trainer.html#ac4e2cdffbfb268c2a320c0099f91494a">set</a> (const std::string &amp;name, const std::string &amp;value)</td></tr>
<tr class="separator:ac4e2cdffbfb268c2a320c0099f91494a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a74ba4064ce086a43070e0a96147e111d"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classchatopera_1_1bot_1_1crfsuite_1_1Trainer.html#a74ba4064ce086a43070e0a96147e111d">get</a> (const std::string &amp;name)</td></tr>
<tr class="separator:a74ba4064ce086a43070e0a96147e111d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab60d99375d698c0db0aea5ec4d57cb00"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classchatopera_1_1bot_1_1crfsuite_1_1Trainer.html#ab60d99375d698c0db0aea5ec4d57cb00">help</a> (const std::string &amp;name)</td></tr>
<tr class="separator:ab60d99375d698c0db0aea5ec4d57cb00"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aacae96619f05e4a497c995df5805d50a"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classchatopera_1_1bot_1_1crfsuite_1_1Trainer.html#aacae96619f05e4a497c995df5805d50a">message</a> (const std::string &amp;msg)</td></tr>
<tr class="separator:aacae96619f05e4a497c995df5805d50a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-static-methods"></a>
静态 Protected 成员函数</h2></td></tr>
<tr class="memitem:a6abf746d57f050dc3d20185de8038fac"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6abf746d57f050dc3d20185de8038fac"></a>
static int&#160;</td><td class="memItemRight" valign="bottom"><b>__logging_callback</b> (void *userdata, const char *format, va_list args)</td></tr>
<tr class="separator:a6abf746d57f050dc3d20185de8038fac"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-attribs"></a>
Protected 属性</h2></td></tr>
<tr class="memitem:a4242e43aa2aeda1e07958a82dac827f3"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4242e43aa2aeda1e07958a82dac827f3"></a>
crfsuite_data_t *&#160;</td><td class="memItemRight" valign="bottom"><b>data</b></td></tr>
<tr class="separator:a4242e43aa2aeda1e07958a82dac827f3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af26320a43ae93006f11fb7f07c1bc570"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af26320a43ae93006f11fb7f07c1bc570"></a>
crfsuite_trainer_t *&#160;</td><td class="memItemRight" valign="bottom"><b>tr</b></td></tr>
<tr class="separator:af26320a43ae93006f11fb7f07c1bc570"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>The trainer class. This class maintains a data set for training, and provides an interface to various graphical models and training algorithms. The standard procedure for implementing a trainer is:</p><ul>
<li>create a class by inheriting this class</li>
<li>overwrite <a class="el" href="classchatopera_1_1bot_1_1crfsuite_1_1Trainer.html#aacae96619f05e4a497c995df5805d50a">message()</a> function to receive messages of training progress</li>
<li>call <a class="el" href="classchatopera_1_1bot_1_1crfsuite_1_1Trainer.html#a83647ff7fa0e30c64c04bb1e56a0529f">append()</a> to append item/label sequences to the training set</li>
<li>call <a class="el" href="classchatopera_1_1bot_1_1crfsuite_1_1Trainer.html#a56b387aafec11fd9239391784136abda">select()</a> to specify a graphical model and an algorithm</li>
<li>call <a class="el" href="classchatopera_1_1bot_1_1crfsuite_1_1Trainer.html#ac4e2cdffbfb268c2a320c0099f91494a">set()</a> to configure parameters specific to the model and algorithm</li>
<li>call <a class="el" href="classchatopera_1_1bot_1_1crfsuite_1_1Trainer.html#aeaacda20768776e7f99f8a672b6123b3">train()</a> to start a training process with the current setting </li>
</ul>
</div><h2 class="groupheader">构造及析构函数说明</h2>
<a class="anchor" id="a47e0b9d2f99b9745c34815493c5bc0c0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">chatopera::bot::crfsuite::Trainer::Trainer </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Construct a trainer. </p>

</div>
</div>
<a class="anchor" id="aad702690d74bca0e38ef4a4e8f392810"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">chatopera::bot::crfsuite::Trainer::~Trainer </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Destruct a trainer. </p>

</div>
</div>
<h2 class="groupheader">成员函数说明</h2>
<a class="anchor" id="a83647ff7fa0e30c64c04bb1e56a0529f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void chatopera::bot::crfsuite::Trainer::append </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="group__crfsuite__hpp__api__doc.html#ga34f58d96010025b06e985a6710fbfd05">ItemSequence</a> &amp;&#160;</td>
          <td class="paramname"><em>xseq</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="group__crfsuite__hpp__api__doc.html#gaf82774957c9896d38894cddd592aa061">StringList</a> &amp;&#160;</td>
          <td class="paramname"><em>yseq</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>group</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Append an instance (item/label sequence) to the data set. </p><dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">xseq</td><td>The item sequence of the instance. </td></tr>
    <tr><td class="paramname">yseq</td><td>The label sequence of the instance. The number of elements in yseq must be identical to that in xseq. </td></tr>
    <tr><td class="paramname">group</td><td>The group number of the instance. </td></tr>
  </table>
  </dd>
</dl>
<dl class="exception"><dt>异常</dt><dd>
  <table class="exception">
    <tr><td class="paramname">std::invalid_argument</td><td>Arguments xseq and yseq are invalid. </td></tr>
    <tr><td class="paramname">std::runtime_error</td><td>Out of memory. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ad12cec6ca40c552981cd877d3ed53c4c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void chatopera::bot::crfsuite::Trainer::clear </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Remove all instances in the data set. </p>

</div>
</div>
<a class="anchor" id="a74ba4064ce086a43070e0a96147e111d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::string chatopera::bot::crfsuite::Trainer::get </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>name</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get the value of a training parameter. This function gets a parameter value for the graphical model and training algorithm specified by <a class="el" href="classchatopera_1_1bot_1_1crfsuite_1_1Trainer.html#a56b387aafec11fd9239391784136abda">select()</a> function. </p><dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>The parameter name. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>std::string The value of the parameter. </dd></dl>
<dl class="exception"><dt>异常</dt><dd>
  <table class="exception">
    <tr><td class="paramname">std::invalid_argument</td><td>The parameter is not found. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ab60d99375d698c0db0aea5ec4d57cb00"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::string chatopera::bot::crfsuite::Trainer::help </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>name</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get the description of a training parameter. This function obtains the help message for the parameter specified by the name. The graphical model and training algorithm must be selected by <a class="el" href="classchatopera_1_1bot_1_1crfsuite_1_1Trainer.html#a56b387aafec11fd9239391784136abda">select()</a> function before calling this function. </p><dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>The parameter name. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>std::string The description (help message) of the parameter. </dd></dl>

</div>
</div>
<a class="anchor" id="a11e2975f51e34d4d0058a84a40459978"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void chatopera::bot::crfsuite::Trainer::init </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Init, call after select </p>

<p><div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="classchatopera_1_1bot_1_1crfsuite_1_1Trainer_a11e2975f51e34d4d0058a84a40459978_icgraph.png" border="0" usemap="#classchatopera_1_1bot_1_1crfsuite_1_1Trainer_a11e2975f51e34d4d0058a84a40459978_icgraph" alt=""/></div>
<map name="classchatopera_1_1bot_1_1crfsuite_1_1Trainer_a11e2975f51e34d4d0058a84a40459978_icgraph" id="classchatopera_1_1bot_1_1crfsuite_1_1Trainer_a11e2975f51e34d4d0058a84a40459978_icgraph">
<area shape="rect" id="node2" href="classchatopera_1_1bot_1_1intent_1_1Trainer.html#a716714ea065d83a00231a188ef9d0a6c" title="chatopera::bot::intent\l::Trainer::train" alt="" coords="224,5,385,47"/>
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="aacae96619f05e4a497c995df5805d50a"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void chatopera::bot::crfsuite::Trainer::message </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>msg</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Receive messages from the training algorithm. Override this member function to receive messages of the training process. </p><dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">msg</td><td>The message </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ad64da31f7d1893927085a90809ad69e0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__crfsuite__hpp__api__doc.html#gaf82774957c9896d38894cddd592aa061">StringList</a> chatopera::bot::crfsuite::Trainer::params </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Obtain the list of parameters. This function returns the list of parameter names available for the graphical model and training algorithm specified by <a class="el" href="classchatopera_1_1bot_1_1crfsuite_1_1Trainer.html#a56b387aafec11fd9239391784136abda">select()</a> function. </p><dl class="section return"><dt>返回</dt><dd>StringList The list of parameters available for the current graphical model and training algorithm. </dd></dl>

</div>
</div>
<a class="anchor" id="a792e40b315cc6526a9d951dd9e55e5ee"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">crfsuite_data_t * chatopera::bot::crfsuite::Trainer::pdata </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get crfsuite_data_t pointer</p>
<p>Get data pointer </p>

</div>
</div>
<a class="anchor" id="a8b95b93e0f76623f8d3c8cd9ab414871"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool chatopera::bot::crfsuite::Trainer::read_data </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>filepath</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>group</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Read data for traing in IWA format.</p>
<p>Read data for training </p>

<p><div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="classchatopera_1_1bot_1_1crfsuite_1_1Trainer_a8b95b93e0f76623f8d3c8cd9ab414871_icgraph.png" border="0" usemap="#classchatopera_1_1bot_1_1crfsuite_1_1Trainer_a8b95b93e0f76623f8d3c8cd9ab414871_icgraph" alt=""/></div>
<map name="classchatopera_1_1bot_1_1crfsuite_1_1Trainer_a8b95b93e0f76623f8d3c8cd9ab414871_icgraph" id="classchatopera_1_1bot_1_1crfsuite_1_1Trainer_a8b95b93e0f76623f8d3c8cd9ab414871_icgraph">
<area shape="rect" id="node2" href="classchatopera_1_1bot_1_1intent_1_1Trainer.html#a716714ea065d83a00231a188ef9d0a6c" title="chatopera::bot::intent\l::Trainer::train" alt="" coords="224,5,385,47"/>
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a56b387aafec11fd9239391784136abda"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool chatopera::bot::crfsuite::Trainer::select </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>algorithm</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>type</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Initialize the training algorithm. </p><dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">algorithm</td><td>The name of the training algorithm. </td></tr>
    <tr><td class="paramname">type</td><td>The name of the graphical model. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>bool <code>true</code> if the training algorithm is successfully initialized, <code>false</code> otherwise. </dd></dl>

<p><div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="classchatopera_1_1bot_1_1crfsuite_1_1Trainer_a56b387aafec11fd9239391784136abda_icgraph.png" border="0" usemap="#classchatopera_1_1bot_1_1crfsuite_1_1Trainer_a56b387aafec11fd9239391784136abda_icgraph" alt=""/></div>
<map name="classchatopera_1_1bot_1_1crfsuite_1_1Trainer_a56b387aafec11fd9239391784136abda_icgraph" id="classchatopera_1_1bot_1_1crfsuite_1_1Trainer_a56b387aafec11fd9239391784136abda_icgraph">
<area shape="rect" id="node2" href="classchatopera_1_1bot_1_1intent_1_1Trainer.html#a716714ea065d83a00231a188ef9d0a6c" title="chatopera::bot::intent\l::Trainer::train" alt="" coords="224,5,385,47"/>
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="ac4e2cdffbfb268c2a320c0099f91494a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void chatopera::bot::crfsuite::Trainer::set </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>value</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Set a training parameter. This function sets a parameter value for the graphical model and training algorithm specified by <a class="el" href="classchatopera_1_1bot_1_1crfsuite_1_1Trainer.html#a56b387aafec11fd9239391784136abda">select()</a> function. </p><dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>The parameter name. </td></tr>
    <tr><td class="paramname">value</td><td>The value of the parameter. </td></tr>
  </table>
  </dd>
</dl>
<dl class="exception"><dt>异常</dt><dd>
  <table class="exception">
    <tr><td class="paramname">std::invalid_argument</td><td>The parameter is not found. </td></tr>
  </table>
  </dd>
</dl>

<p><div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="classchatopera_1_1bot_1_1crfsuite_1_1Trainer_ac4e2cdffbfb268c2a320c0099f91494a_icgraph.png" border="0" usemap="#classchatopera_1_1bot_1_1crfsuite_1_1Trainer_ac4e2cdffbfb268c2a320c0099f91494a_icgraph" alt=""/></div>
<map name="classchatopera_1_1bot_1_1crfsuite_1_1Trainer_ac4e2cdffbfb268c2a320c0099f91494a_icgraph" id="classchatopera_1_1bot_1_1crfsuite_1_1Trainer_ac4e2cdffbfb268c2a320c0099f91494a_icgraph">
<area shape="rect" id="node2" href="classchatopera_1_1bot_1_1intent_1_1Trainer.html#a716714ea065d83a00231a188ef9d0a6c" title="chatopera::bot::intent\l::Trainer::train" alt="" coords="224,5,385,47"/>
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="aeaacda20768776e7f99f8a672b6123b3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int chatopera::bot::crfsuite::Trainer::train </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>model</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>holdout</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Run the training algorithm. This function starts the training algorithm with the data set given by <a class="el" href="classchatopera_1_1bot_1_1crfsuite_1_1Trainer.html#a83647ff7fa0e30c64c04bb1e56a0529f">append()</a> function. After starting the training process, the training algorithm invokes the virtual function <a class="el" href="classchatopera_1_1bot_1_1crfsuite_1_1Trainer.html#aacae96619f05e4a497c995df5805d50a">message()</a> to report the progress of the training process. </p><dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">model</td><td>The filename to which the trained model is stored. If this value is empty, this function does not write out a model file. </td></tr>
    <tr><td class="paramname">holdout</td><td>The group number of holdout evaluation. The instances with this group number will not be used for training, but for holdout evaluation. Specify <code>-1</code> to use all instances for training. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>int The status code. </dd></dl>

<p><div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="classchatopera_1_1bot_1_1crfsuite_1_1Trainer_aeaacda20768776e7f99f8a672b6123b3_icgraph.png" border="0" usemap="#classchatopera_1_1bot_1_1crfsuite_1_1Trainer_aeaacda20768776e7f99f8a672b6123b3_icgraph" alt=""/></div>
<map name="classchatopera_1_1bot_1_1crfsuite_1_1Trainer_aeaacda20768776e7f99f8a672b6123b3_icgraph" id="classchatopera_1_1bot_1_1crfsuite_1_1Trainer_aeaacda20768776e7f99f8a672b6123b3_icgraph">
<area shape="rect" id="node2" href="classchatopera_1_1bot_1_1intent_1_1Trainer.html#a716714ea065d83a00231a188ef9d0a6c" title="chatopera::bot::intent\l::Trainer::train" alt="" coords="224,5,385,47"/>
</map>
</div>
</p>

</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>src/ner/src/<a class="el" href="crfsuite__api_8hpp_source.html">crfsuite_api.hpp</a></li>
<li>src/ner/src/<a class="el" href="crfsuite_8hpp_source.html">crfsuite.hpp</a></li>
</ul>
</div><!-- contents -->
<address class="footer">
    <small>
        &nbsp; Copyright (c) (2019-2020) &nbsp;<a href="https://www.chatopera.com">
            北京华夏春松科技有限公司
        </a>. All Rights Reserved
        &nbsp;
    </small>
</address>